package com.example.shop_2208.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.shop_2208.R
import com.example.shop_2208.entity.GoodsEntity
import com.example.shop_2208.utils.GlideUtils

class GoodsAdapter:BaseQuickAdapter<GoodsEntity,BaseViewHolder>(R.layout.item_goods) {
    override fun convert(holder: BaseViewHolder, item: GoodsEntity) {
        holder.setText(R.id.goods_desc,item.goods_desc)
        holder.setText(R.id.goods_price,"${item.goods_default_price}元起")//不能直接给item.goods_default_price 会报错
        GlideUtils.loadImage(context,holder.getView(R.id.goods_iv),item.goods_default_icon)
    }
}